Multiple JSON tags in Go
Go’s standard JSON library, encoding/json, is very thorough and is good enough for most use cases. Its most used functionalities are Marshal and Unmarshal, which respectively take care of turning a Go struct into its JSON representation and vice versa.
There are, however, situations in which the standard JSON library is simply not enough. One of these situations is wanting to handle several different tags for a single struct. Let’s take a look at an example to understand this problem better:
[Read More]